package com.util;

import com.bean.dto.ProductDto;
/**
 * 产品数据传输工具
 */
public class ProductDtoUtil {
    public static ProductDto returnSuccess(){
        return new ProductDto(0,null,null,0);
    }
    public static ProductDto returnSuccess(String msg){
        return new ProductDto(0,msg,null,0);
    }
    public static ProductDto returnSuccess(Object data,int count){
        return new ProductDto(0,null,data,count);
    }
    public static ProductDto returnFail(String msg){
        return new ProductDto(200,msg,null,0);
    }
    public static ProductDto returnError(Integer code){
        return new ProductDto(code,null,null,0);
    }
    public static ProductDto returnError(Integer code,String msg){
        return new ProductDto(code,msg,null,0);
    }
}
